\(\int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx\) [966]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 73 \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {(A+B) \sec ^5(c+d x) (a+a \sin (c+d x))}{5 d}+\frac {a (4 A-B) \tan (c+d x)}{5 d}+\frac {a (4 A-B) \tan ^3(c+d x)}{15 d} \]

[Out]

1/5*(A+B)*sec(d*x+c)^5*(a+a*sin(d*x+c))/d+1/5*a*(4*A-B)*tan(d*x+c)/d+1/15*a*(4*A-B)*tan(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2934, 3852} \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {a (4 A-B) \tan ^3(c+d x)}{15 d}+\frac {a (4 A-B) \tan (c+d x)}{5 d}+\frac {(A+B) \sec ^5(c+d x) (a \sin (c+d x)+a)}{5 d} \]

[In]

Int[Sec[c + d*x]^6*(a + a*Sin[c + d*x])*(A + B*Sin[c + d*x]),x]

[Out]

((A + B)*Sec[c + d*x]^5*(a + a*Sin[c + d*x]))/(5*d) + (a*(4*A - B)*Tan[c + d*x])/(5*d) + (a*(4*A - B)*Tan[c +
d*x]^3)/(15*d)

Rule 2934

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Simp[(-(b*c + a*d))*(g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(a*f*g*(p +
 1))), x] + Dist[b*((a*d*m + b*c*(m + p + 1))/(a*g^2*(p + 1))), Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*
x])^(m - 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[a^2 - b^2, 0] && GtQ[m, -1] && LtQ[p, -1]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(A+B) \sec ^5(c+d x) (a+a \sin (c+d x))}{5 d}+\frac {1}{5} (a (4 A-B)) \int \sec ^4(c+d x) \, dx \\ & = \frac {(A+B) \sec ^5(c+d x) (a+a \sin (c+d x))}{5 d}-\frac {(a (4 A-B)) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{5 d} \\ & = \frac {(A+B) \sec ^5(c+d x) (a+a \sin (c+d x))}{5 d}+\frac {a (4 A-B) \tan (c+d x)}{5 d}+\frac {a (4 A-B) \tan ^3(c+d x)}{15 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.66 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.11 \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {a \left (3 (A+B) \sec ^5(c+d x)+15 A \sec ^4(c+d x) \tan (c+d x)-5 (4 A-B) \sec ^2(c+d x) \tan ^3(c+d x)+2 (4 A-B) \tan ^5(c+d x)\right )}{15 d} \]

[In]

Integrate[Sec[c + d*x]^6*(a + a*Sin[c + d*x])*(A + B*Sin[c + d*x]),x]

[Out]

(a*(3*(A + B)*Sec[c + d*x]^5 + 15*A*Sec[c + d*x]^4*Tan[c + d*x] - 5*(4*A - B)*Sec[c + d*x]^2*Tan[c + d*x]^3 +
2*(4*A - B)*Tan[c + d*x]^5))/(15*d)

Maple [A] (verified)

Time = 0.50 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.40

method result size
derivativedivides \(\frac {\frac {a A}{5 \cos \left (d x +c \right )^{5}}+B a \left (\frac {\sin ^{3}\left (d x +c \right )}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \left (\sin ^{3}\left (d x +c \right )\right )}{15 \cos \left (d x +c \right )^{3}}\right )-a A \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )+\frac {B a}{5 \cos \left (d x +c \right )^{5}}}{d}\) \(102\)
default \(\frac {\frac {a A}{5 \cos \left (d x +c \right )^{5}}+B a \left (\frac {\sin ^{3}\left (d x +c \right )}{5 \cos \left (d x +c \right )^{5}}+\frac {2 \left (\sin ^{3}\left (d x +c \right )\right )}{15 \cos \left (d x +c \right )^{3}}\right )-a A \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )+\frac {B a}{5 \cos \left (d x +c \right )^{5}}}{d}\) \(102\)
risch \(-\frac {4 i a \left (24 i A \,{\mathrm e}^{3 i \left (d x +c \right )}-6 i B \,{\mathrm e}^{3 i \left (d x +c \right )}+15 B \,{\mathrm e}^{4 i \left (d x +c \right )}+8 i A \,{\mathrm e}^{i \left (d x +c \right )}+8 A \,{\mathrm e}^{2 i \left (d x +c \right )}-2 i B \,{\mathrm e}^{i \left (d x +c \right )}-2 B \,{\mathrm e}^{2 i \left (d x +c \right )}+4 A -B \right )}{15 \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{3} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{5} d}\) \(131\)
parallelrisch \(-\frac {2 \left (A \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A +B \right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (-A -2 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {\left (5 A +B \right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {\left (13 A +8 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15}+\frac {\left (-7 A +3 B \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {\left (3 A -2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{5}+\frac {A}{5}+\frac {B}{5}\right ) a}{d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}\) \(166\)
norman \(\frac {-\frac {2 a A +2 B a}{5 d}-\frac {\left (2 a A +2 B a \right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (4 a A +4 B a \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {\left (4 a A +4 B a \right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (6 a A +6 B a \right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (8 a A +8 B a \right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (22 a A +22 B a \right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {2 a A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 a A \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a \left (A +2 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 a \left (A +2 B \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 a \left (11 A +16 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {2 a \left (11 A +16 B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {8 a \left (19 A +14 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}\) \(347\)

[In]

int(sec(d*x+c)^6*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/5*a*A/cos(d*x+c)^5+B*a*(1/5*sin(d*x+c)^3/cos(d*x+c)^5+2/15*sin(d*x+c)^3/cos(d*x+c)^3)-a*A*(-8/15-1/5*se
c(d*x+c)^4-4/15*sec(d*x+c)^2)*tan(d*x+c)+1/5*B*a/cos(d*x+c)^5)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.53 \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=-\frac {2 \, {\left (4 \, A - B\right )} a \cos \left (d x + c\right )^{4} - {\left (4 \, A - B\right )} a \cos \left (d x + c\right )^{2} - {\left (A - 4 \, B\right )} a + {\left (2 \, {\left (4 \, A - B\right )} a \cos \left (d x + c\right )^{2} + {\left (4 \, A - B\right )} a\right )} \sin \left (d x + c\right )}{15 \, {\left (d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right ) - d \cos \left (d x + c\right )^{3}\right )}} \]

[In]

integrate(sec(d*x+c)^6*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/15*(2*(4*A - B)*a*cos(d*x + c)^4 - (4*A - B)*a*cos(d*x + c)^2 - (A - 4*B)*a + (2*(4*A - B)*a*cos(d*x + c)^2
 + (4*A - B)*a)*sin(d*x + c))/(d*cos(d*x + c)^3*sin(d*x + c) - d*cos(d*x + c)^3)

Sympy [F(-1)]

Timed out. \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\text {Timed out} \]

[In]

integrate(sec(d*x+c)**6*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.18 \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {{\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} A a + {\left (3 \, \tan \left (d x + c\right )^{5} + 5 \, \tan \left (d x + c\right )^{3}\right )} B a + \frac {3 \, A a}{\cos \left (d x + c\right )^{5}} + \frac {3 \, B a}{\cos \left (d x + c\right )^{5}}}{15 \, d} \]

[In]

integrate(sec(d*x+c)^6*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/15*((3*tan(d*x + c)^5 + 10*tan(d*x + c)^3 + 15*tan(d*x + c))*A*a + (3*tan(d*x + c)^5 + 5*tan(d*x + c)^3)*B*a
 + 3*A*a/cos(d*x + c)^5 + 3*B*a/cos(d*x + c)^5)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 225 vs. \(2 (67) = 134\).

Time = 0.30 (sec) , antiderivative size = 225, normalized size of antiderivative = 3.08 \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=-\frac {\frac {5 \, {\left (15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 13 \, A a - 7 \, B a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{3}} + \frac {165 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 45 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 480 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 60 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 650 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 70 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 400 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 20 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 113 \, A a + 13 \, B a}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{5}}}{120 \, d} \]

[In]

integrate(sec(d*x+c)^6*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/120*(5*(15*A*a*tan(1/2*d*x + 1/2*c)^2 - 9*B*a*tan(1/2*d*x + 1/2*c)^2 + 24*A*a*tan(1/2*d*x + 1/2*c) - 12*B*a
*tan(1/2*d*x + 1/2*c) + 13*A*a - 7*B*a)/(tan(1/2*d*x + 1/2*c) + 1)^3 + (165*A*a*tan(1/2*d*x + 1/2*c)^4 + 45*B*
a*tan(1/2*d*x + 1/2*c)^4 - 480*A*a*tan(1/2*d*x + 1/2*c)^3 - 60*B*a*tan(1/2*d*x + 1/2*c)^3 + 650*A*a*tan(1/2*d*
x + 1/2*c)^2 + 70*B*a*tan(1/2*d*x + 1/2*c)^2 - 400*A*a*tan(1/2*d*x + 1/2*c) - 20*B*a*tan(1/2*d*x + 1/2*c) + 11
3*A*a + 13*B*a)/(tan(1/2*d*x + 1/2*c) - 1)^5)/d

Mupad [B] (verification not implemented)

Time = 11.74 (sec) , antiderivative size = 224, normalized size of antiderivative = 3.07 \[ \int \sec ^6(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=-\frac {a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A\,\cos \left (\frac {5\,c}{2}+\frac {5\,d\,x}{2}\right )}{4}-\frac {9\,A\,\cos \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{4}-A\,\cos \left (\frac {7\,c}{2}+\frac {7\,d\,x}{2}\right )-\frac {15\,B\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}+\frac {3\,B\,\cos \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{2}-B\,\cos \left (\frac {5\,c}{2}+\frac {5\,d\,x}{2}\right )+\frac {B\,\cos \left (\frac {7\,c}{2}+\frac {7\,d\,x}{2}\right )}{4}-\frac {73\,A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8}+\frac {25\,A\,\sin \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{8}-\frac {19\,A\,\sin \left (\frac {5\,c}{2}+\frac {5\,d\,x}{2}\right )}{8}+\frac {3\,A\,\sin \left (\frac {7\,c}{2}+\frac {7\,d\,x}{2}\right )}{8}+\frac {7\,B\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8}+\frac {5\,B\,\sin \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{8}+\frac {B\,\sin \left (\frac {5\,c}{2}+\frac {5\,d\,x}{2}\right )}{8}+\frac {3\,B\,\sin \left (\frac {7\,c}{2}+\frac {7\,d\,x}{2}\right )}{8}\right )}{120\,d\,{\cos \left (\frac {c}{2}-\frac {\pi }{4}+\frac {d\,x}{2}\right )}^3\,{\cos \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d\,x}{2}\right )}^5} \]

[In]

int(((A + B*sin(c + d*x))*(a + a*sin(c + d*x)))/cos(c + d*x)^6,x)

[Out]

-(a*cos(c/2 + (d*x)/2)*((A*cos((5*c)/2 + (5*d*x)/2))/4 - (9*A*cos((3*c)/2 + (3*d*x)/2))/4 - A*cos((7*c)/2 + (7
*d*x)/2) - (15*B*cos(c/2 + (d*x)/2))/4 + (3*B*cos((3*c)/2 + (3*d*x)/2))/2 - B*cos((5*c)/2 + (5*d*x)/2) + (B*co
s((7*c)/2 + (7*d*x)/2))/4 - (73*A*sin(c/2 + (d*x)/2))/8 + (25*A*sin((3*c)/2 + (3*d*x)/2))/8 - (19*A*sin((5*c)/
2 + (5*d*x)/2))/8 + (3*A*sin((7*c)/2 + (7*d*x)/2))/8 + (7*B*sin(c/2 + (d*x)/2))/8 + (5*B*sin((3*c)/2 + (3*d*x)
/2))/8 + (B*sin((5*c)/2 + (5*d*x)/2))/8 + (3*B*sin((7*c)/2 + (7*d*x)/2))/8))/(120*d*cos(c/2 - pi/4 + (d*x)/2)^
3*cos(c/2 + pi/4 + (d*x)/2)^5)